<?php

class RollOverComponent extends BlueprintComponent {
	
	function parse(&$element, $className, $if = null) {
		if (!empty($if)) {
			$if = "if($if){";
			$endIf = "}";
		} else {
			$endIf = "}";
		}
		$element->attributes['onmouseover'] = "{$if}this.oldClass=this.className;this.className='$className';$endIf";
		$element->attributes['onmouseout'] = "{$if}this.className=this.oldClass;$endIf";
	}
}
?>